package com.wink_172.library

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log

open class GobalReceiver : BroadcastReceiver() {
    //命令行发送广播  请注意需要在manifest.xml中注册
    override fun onReceive(context: Context, intent: Intent) {
        if (intent == null) {
            return
        }
        val action = intent.action
        val uri = intent.data

        // uri --> android_secret_code://1234
        //  host  -->  1234
//        val host = uri!!.host
        Log.e(TAG, "lib onReceice====>>$action ") //
//        if ("1001" == host) {
//        } else if ("2807" == host) {
//            Intent intent2 = new Intent(AppManager.getAppManager().currentActivity(), LanguageActivity.class);
//            intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//            context.startActivity(intent2);
//        }
    }

    companion object {
        private const val TAG = "TAG"
    }
}